<extend name="Layout/dialog" />
<block name="css"></block>
<block name="style"></block>
<block name="js"></block>
<block name="script"></block>
<block name="model">基本设置</block>
<block name="controller">首付设置</block>
<block name="action">编辑首付设置</block>
<block name="desc"></block>
<block name="content">
    <div class="box box-success">
        <div class="box-header with-border">
            <h3 class="box-title">编辑首付设置</h3>
        </div>
        <notempty name="data">
            <form class="form-horizontal" action="{:U('save')}" method="post" rel-action="form" rel-success="reload()">
                <div class="box-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="text-red">*</span>贷款类型</label>
                        <div class="col-sm-10">
							<input type="text" class="form-control" name="loan_type" value="{$data['payment_loan_type']}" placeholder="请输入贷款类型" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="text-red">*</span>商品分类</label>
                        <div class="col-sm-10">
                            
							<input type="text" class="form-control" name="commodity_type" value="{$data['payment_commodity_type']}" placeholder="请输入商品分类" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="text-red">*</span>分期数</label>
                        <div class="col-sm-10">
                            <select class="form-control" name="stages">
                                <volist name="stages" id="m">
                                    <if condition="$m == $data['payment_stages']">
                                        <option value="{$m}" selected='selected'>{$m}</option>
                                        <else />
                                        <option value="{$m}">{$m}</option>
                                    </if>
                                </volist>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="text-red">*</span>首付类型</label>
                        <div class="col-sm-10">
                            <volist name="type" id="m">
                                <label class="radio-inline">
                                    <if condition="$key == $data['payment_type']">
                                        <input type="radio" name="type" value="{$key}" checked='checked'> {$m}
                                        <else />
                                        <input type="radio" name="type" value="{$key}"> {$m}
                                    </if>
                                </label>
                            </volist>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="text-red">*</span>首付值</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="value" value="{$data.payment_value|floatval}" placeholder="请输入首付值" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">附加属性</label>
                        <div class="col-sm-10">
                            <textarea type="text" class="form-control" name="data" placeholder="附加属性"  autocomplete="off">{$data.payment_data}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">排序</label>
                        <div class="col-sm-10">
                            <input type="number" class="form-control" name="order" placeholder="请填写整数，数字越小越靠前" autocomplete="off" value="{$data.payment_order}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态</label>
                        <div class="col-sm-10 radio">
                            <label>
                                <if condition="$data.payment_status == 1">
                                    <input type="radio" name="status" value="1" checked="checked">正常
                                    <else />
                                    <input type="radio" name="status" value="1">正常
                                </if>
                            </label>
                            <label>
                                <if condition="$data.payment_status == 0">
                                    <input type="radio" name="status" value="0" checked="checked">锁定
                                    <else />
                                    <input type="radio" name="status" value="0">锁定
                                </if>
                            </label>
                        </div>
                    </div>
                </div>
                <input type="hidden" name="id" value="{$data.payment_id}">
                <div class="box-footer">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-default">保存</button>
                        <button type="button" class="btn btn-default" rel-action="dialog-close">关闭</button>
                    </div>
                </div>
            </form>
        </notempty>
        <empty name="data">
            <div class="box-body">
                <div class="alert alert-error alert-dismissible">
                    <h4><i class="icon fa fa-warning"></i>暂无记录</h4>
                    参数有误
                </div>
            </div>
        </empty>
    </div>
</block>